{include file="public/head" /}
<!--有理想的地方，地狱都是天堂-->
<!--Copyright @ df81.com 版权所有-->
<!--作者: 南国老符 邮箱：1062129401@qq.com-->
        <!-- 左侧菜单 开始 -->
        <div class="sidebar">
            <nav>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_content" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_data" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_global" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_system" /}
                </ul>
            </nav>
        </div>
        <!-- 左侧菜单 结束 -->
    </aside>
    <!-- 左侧 结束 -->
    <!-- 右侧 开始 -->
    <div class="content-wrapper">
        <!-- 内容导航 开始 -->
        <div class="content-header py-2 bg-white mb-3">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12">
                        <ol class="breadcrumb">
                            <li>{:lang('v_global')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{:lang('v_global')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{:lang('v_friendlink')}</li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
        <!-- 内容导航 结束 -->
        <!-- 内容主体 开始 -->
        <section class="content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-body">
                                <div class="w-100 mb-3">
                                    <form name="form_keyword" action="" method="post" class="row">
                                        <input type="hidden" name="lang" value="{$lang}">
                                        <div class="col-md-8 px-2">
                                            <a class="btn {if input('att_type') eq 'link' and input('signid') neq 9}btn-success{else /}btn-default{/if} mb-2 mr-2" href="{:url('/ad/index',['lang'=>$lang,'signid'=>1,'att_type'=>'link'])}"><i class="fa fa-fw fa-link mr-1"></i>{:lang('v_friendlink')}</a>
                                            <a class="btn mb-2 mr-2 {if input('signid') eq 9}btn-success{else /}btn-default{/if}" href="{:url('/ad/index',['lang'=>$lang,'signid'=>9,'att_type'=>'link'])}"><i class="fa fa-fw fa-recycle mr-1"></i>{:lang('v_recycle')}</a>
                                            <a class="btn btn-default mb-2 mr-2" href="{:url('/ad/edit',['lang'=>$lang,'att_type'=>'link'])}"><i class="fa fa-fw fa-plus-circle mr-1"></i>{:lang('v_add')} {:lang('v_friendlink')}</a>
                                        </div>
                                        <div class="col-md-4 px-2">
                                            <div class="input-group">
                                                <input name="keyword" placeholder="{:lang('v_quickfind')}" type="text" class="form-control">
                                                <span class="input-group-append">
                                                    <button type="submit" class="btn btn-success"><i class="fa fa-search mr-1"></i>{:lang('v_search')}</button>
                                                </span>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <table class="table table-striped table-bordered table-hover">
                                    <form name="form_list" id="form_list" action="" method="post">
                                        <tr>
                                            <th width="100" class="text-center">ID</th>
                                            <th class="d-invisible">{:lang('v_title')}</th>
                                            <th class="text-center">{:lang('v_linkurl')}</th>
                                            <th width="230" class="text-center">{:lang('v_client')}</th>
                                            <th class="d-invisible text-center">{:lang('v_position')}</th>
                                            <th width="150" class="text-center d-invisible">{:lang('v_sequence')}</th>
                                            <th width="280" class="text-center">{:lang('v_do')}</th>
                                        </tr>
                                        {volist name="list" id="rs"}
                                            <input type="hidden" name="id[]" value="{$rs.id}" />
                                            <tr>
                                                <td class="text-center">
                                                    <label class="form-check form-check-inline">
                                                        <input type="checkbox" name="selectid[]" id="selectid" value="{$rs.id}" class="mr-1" />
                                                        <span class="d-invisible">{$rs.id}</span>
                                                    </label>
                                                </td>
                                                <td class="d-invisible">
                                                    <input type="text" name="title[]" class="form-control" value="{$rs.title}">
                                                </td>
                                                <td class="text-center">
                                                    <input type="text" name="linkurl[]" class="form-control" value="{$rs.linkurl}">
                                                </td>
                                                <td class="text-center">
                                                    {php}$clientArr = explode(',',$rs['client']);{/php}
                                                    {foreach $clientArr as $client}
                                                        {eq name="client" value="pc"}
                                                            [{:lang('v_client_pc')}]
                                                        {/eq}
                                                        {eq name="client" value="wap"}
                                                            [{:lang('v_client_mobile')}]
                                                        {/eq}
                                                        {eq name="client" value="app"}
                                                            [{:lang('v_client_uniapp')}]
                                                        {/eq}
                                                    {/foreach}
                                                </td>
                                                <td class="d-invisible text-center">
                                                    {eq name="rs.position" value="index"}
                                                        {:lang('v_index')}
                                                    {else /}
                                                        {php}$position = $rs['position'];{/php}
                                                        {tag:list name="positionRs" table="module" where="lang='$lang' and tabledir='$position'" limit="1" order="id desc"}
                                                            {$positionRs.title}
                                                        {/tag:list}
                                                    {/eq}
                                                </td>
                                                <td class="text-center d-invisible">
                                                    <input name="sequence[]" type="text" value="{$rs.sequence}" class="input" size="5" />
                                                </td>
                                                <td class="text-center">
                                                    <a href="{:url('/ad/edit',['lang'=>$lang,'id'=>$rs['id'],'att_type'=>'link'])}" class="btn btn-sm btn-success mb-2 mr-2"><i class="fa fa-fw fa-edit mr-1"></i>{:lang('v_edit')}</a>
                                                    {switch signid}
                                                        {case 9}
                                                            <!-- 回收站 -->
                                                            <!-- 恢复 -->
                                                            <span onClick="javascript:do_ajax('','','{:url('/ad/update_signid',['lang'=>$lang,'signid'=>1,'id'=>$rs['id'],'att_type'=>'link'])}','');" class="btn btn-sm btn-purple mb-2 mr-2"><i class="fa fa-fw fa-reply-all mr-1"></i>{:lang('v_restore')}</span>
                                                            <!-- 真实删除 -->
                                                            <span onClick="javascript:do_confirm('','','{:url('/ad/delete_one',['lang'=>$lang,'id'=>$rs['id'],'att_type'=>'link'])}','','');" class="btn btn-sm btn-danger mb-2"><i class="fas fa-fw fa-trash mr-1"></i>{:lang('v_delete')}</span>
                                                        {/case}
                                                        {default /}
                                                            <!-- 软删除 -->
                                                            <span class="btn btn-sm btn-danger mb-2" onClick="javascript:do_ajax('','','{:url('/ad/update_signid',['lang'=>$lang,'signid'=>9,'id'=>$rs['id'],'att_type'=>'link'])}','');"><i class="fa fa-fw fa-trash mr-1"></i>{:lang('v_delete')}</span>
                                                    {/switch}
                                                </td>
                                            </tr>
                                        {/volist}
                                        <tr>
                                            <td colspan="8">
                                                <div class="row">
                                                    <div class="col-xl-6 mt-2"><div class="float-lg-left mr-4">{$list->render()|raw}</div><div class="float-lg-left">{:lang('v_total')} {$lastPage} {:lang('v_page')} {$total} {:lang('v_records')}</div></div>
                                                    <div class="col-xl-6 mt-2 mt-md-1">
                                                        <div class="float-left float-xl-right">
                                                            <!-- 全选 -->
                                                            <button type="button" class="btn btn-info mr-2 checkbox-toggle"><i class="far fa-fw fa-square mr-1"></i>{:lang('v_select_all')}</button>
                                                            <!-- 更新 -->
                                                            <button type="button" class="btn btn-success mr-2" onClick="javascript:do_ajax('#form_list','','{:url('/ad/update_all',['lang'=>$lang,'att_type'=>'link'])}','');"><i class="fa fa-fw fa-sync-alt mr-1"></i>{:lang('v_batch')} {:lang('v_update')}</button>
                                                            {switch signid}
                                                                {case 9}
                                                                    <!-- 回收站 -->
                                                                    <!-- 恢复 -->
                                                                    <button type="button" class="btn btn-purple mr-2" onClick="javascript:do_ajax('#form_list','','{:url('/ad/updateall_signid',['lang'=>$lang,'signid'=>1,'att_type'=>'link'])}','');"><i class="fa fa-fw fa-reply-all mr-1"></i>{:lang('v_restore_select')}</button>
                                                                    <!-- 真实删除 -->
                                                                    <button type="button" class="btn btn-danger" onClick="javascript:do_confirm('#form_list','','{:url('/ad/delete_all',['lang'=>$lang,'att_type'=>'link'])}','','');"><i class="fa fa-fw fa-trash mr-1"></i>{:lang('v_delete_select')}</button>
                                                                {/case}
                                                                {default /}
                                                                    <!-- 软删除 -->
                                                                    <button type="button" class="btn btn-danger" onClick="javascript:do_ajax('#form_list','','{:url('/ad/updateall_signid',['lang'=>$lang,'signid'=>9,'att_type'=>'link'])}','');"><i class="fa fa-fw fa-trash mr-1"></i>{:lang('v_delete_select')}</button>
                                                            {/switch}
                                                        </div>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    </form>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- 内容主体 结束 -->
    </div>
    <!-- 右侧 结束 -->
{include file="public/foot" /}
</body>
</html>